/*
 * Copyright 2008 Andrej Herich
 * 
 * http://azetclient.yw.sk/
 * http://azetclient.googlecode.com/
 * 
 * This file is part of AzetClient.
 * 
 * AzetClient is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * AzetClient is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with AzetClient.  If not, see <http://www.gnu.org/licenses/>.
 */

package sk.yw.azetclient.connection;

import java.util.List;
import sk.yw.azetclient.model.Buddy;
import sk.yw.azetclient.model.Message;
import sk.yw.azetclient.model.MessageBean;

/**
 *
 * @author error216
 */
public interface SiteConnection {
    
    boolean authenticate(Buddy user, String password)
	    throws ConnectionException;
    
    Buddy getUser();
    
    boolean isAuthenticated()
	    throws ConnectionException;
    
    void disconnect()
	    throws ConnectionException;
    
    List<Buddy> getBuddies()
            throws ConnectionException;
    
    List<MessageBean> getMessages()
            throws ConnectionException;
    
    /**
     * Sends the message.
     * 
     * @param  message  message to send
     * @return true, if messages was send succesfully, false otherwise
     * @throws sk.yw.azetclient.AzetClientException
     */
    boolean sendMessage(Message message)
            throws ConnectionException;
}
